home *** CD-ROM | disk | FTP | other *** search
- { %filename% -- application methods }
- { Created %date% %time% by AppMaker }
-
- { We recommend that you not modify this module and instead modify }
- { its subclass, %Appname%App. The 'z' prefix on this module marks% %}
- { a module which is likely to be regenerated by AppMaker after you }
- { make changes to the user interface. The modules without the 'z' }
- { prefix will not be regenerated by AppMaker unless you delete them. }
- { Using a separate subclass to override the AppMaker-generated code }
- { lets you regenerate code without losing your hand-coded changes. }
-
- Unit %unitname%;
- Interface
-
- Uses
- TCL,
- FW_Tearoffs,
- AMCL,
- %AppName%Intf,
- %for each dialog gen usesModeless%
- ResourceDefs;
-
- {----------}
- Implementation
-
- const
- kExtraMasters = 4;
- kRainyDayFund = 20480;
- kCriticalBalance = 20480;
- kToolboxBalance = 20480;
-
- {----------}
- Procedure Z%Appname%App.I%Appname%App;
- Begin
- IApplication (kExtraMasters, kRainyDayFund,
- kCriticalBalance, kToolboxBalance);
-
- %for each dialog gen createModeless%
-
- End; {I%Appname%App}
-
- {----------}
- Procedure Z%Appname%App.MakeDesktop;
- var
- fwDesktop: CFWDesktop;
- Begin
- New (fwDesktop);
- fwDesktop.IFWDesktop (self);
- gDesktop := fwDesktop;
-
- End; {MakeDesktop}
-
- {----------}
- Procedure Z%Appname%App.SetUpMenus;
- var
- macMenu: MenuHandle;
- Begin
- inherited SetUpMenus;
- %for each menu gen setup%
-
- %for each menu gen addPopup%
-
- End; {SetUpMenus}
-
- {----------}
- Procedure Z%Appname%App.CreateDocument;
- var
- theDocument:% %C%Appname%Doc;
- fi: FailInfo;
-
- {----------}
- Procedure HandleFailure (error: Integer;
- message: Longint);
- Begin
- ForgetObject (theDocument);
- End;
-
- Begin
- theDocument := nil;
- CatchFailures (fi, HandleFailure);
-
- New (theDocument);
- theDocument.I%Appname%Doc (self, true);
- theDocument.NewFile;
-
- Success;
- End; {CreateDocument}
-
- {----------}
- Procedure Z%Appname%App.OpenDocument (macSFReply: SFReply);
- var
- theDocument:% %C%Appname%Doc;
- fi: FailInfo;
-
- {----------}
- Procedure HandleFailure (error: Integer;
- message: Longint);
- Begin
- ForgetObject (theDocument);
- End;
-
- Begin
- theDocument := nil;
- CatchFailures (fi, HandleFailure);
-
- New (theDocument);
- theDocument.I%Appname%Doc (self, true);
- theDocument.OpenFile (macSFReply);
-
- Success;
- End; {OpenDocument}
-
- %if fileExists appname+App.p%
- {----------}
- { This code should be in %Appname%App.p rather than in this file. }
- { AppMaker generated it here because %Appname%App.p already existed. }
- { AppMaker doesn't overwrite an existing non-Z file because it }
- { might have lots of user hand-written code. }
- {----------}
- Procedure Z%Appname%App.UpdateMenus;
- Begin
- inherited UpdateMenus;
- %for each menu gen updateAppMenus%
-
- End; {UpdateMenus}
-
- %endif%
- {----------}
- Procedure Z%Appname%App.DoCommand (theCommand: longint);
- var
- itemNr: integer;
- Begin
- case theCommand of
- cmdAbout:
- itemNr := Alert (1, nil);
- %if fileExists appname+App.p%
- %for each menu gen handleAppItems%
- %endif%
-
- otherwise
- inherited DoCommand (theCommand);
- end; {case}
- End; {DoCommand}
-
- End. {%unitname%}
-